home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / apport / package-hooks / source_linux.py < prev    next >
Encoding:
Python Source  |  2009-09-25  |  1.0 KB  |  34 lines

  1. '''Apport package hook for the Linux kernel.
  2.  
  3. (c) 2008 Canonical Ltd.
  4. Contributors:
  5. Matt Zimmerman <mdz@canonical.com>
  6. Martin Pitt <martin.pitt@canonical.com>
  7.  
  8. This program is free software; you can redistribute it and/or modify it
  9. under the terms of the GNU General Public License as published by the
  10. Free Software Foundation; either version 2 of the License, or (at your
  11. option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
  12. the full text of the license.
  13. '''
  14.  
  15. import os
  16. import subprocess
  17. from apport.hookutils import *
  18.  
  19. def add_info(report):
  20.     attach_hardware(report)
  21.  
  22.     attach_file_if_exists(report, "/etc/initramfs-tools/conf.d/resume",
  23.                           key="HibernationDevice")
  24.  
  25.     version_signature = report.get('ProcVersionSignature', '')
  26.     if not version_signature.startswith('Ubuntu '):
  27.         report['UnreportableReason'] = _('The running kernel is not an Ubuntu kernel')
  28.  
  29. if __name__ == '__main__':
  30.     report = {}
  31.     add_info(report)
  32.     for key in report:
  33.         print '%s: %s' % (key, report[key].split('\n', 1)[0])
  34.